home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / pc / windows / qtw_201 / setup / samples / browser / fileexts.rh < prev    next >
Encoding:
Text File  |  1994-12-19  |  3.2 KB  |  97 lines

  1.  
  2. // ---------------------------------------------------------------------
  3. //
  4. // fileexts.rc - Common Routines - QuickTime for Windows
  5. //
  6. //               Version 1.0
  7. //
  8. //               (c) Copyright 1988-1994 Apple Computer, Inc. All Rights Reserved.
  9. //
  10. // ---------------------------------------------------------------------
  11.  
  12.  
  13. // Protect against multiple inclusion
  14. // ----------------------------------
  15.    #ifndef __FILEEXTS__
  16.    #define __FILEEXTS__
  17.  
  18.  
  19. // These symbols use values that must be RESERVED by calling applications.
  20. // i.e. they must not conflict with the id's of any other string resources.
  21. // ------------------------------------------------------------------------
  22.    #define COMMON_FILEEXT_FIRST     58790
  23.  
  24.    #define COMMON_MOVIES_FILEEXT    COMMON_FILEEXT_FIRST+0
  25.    #define COMMON_PICTURES_FILEEXT  COMMON_FILEEXT_FIRST+8
  26.    #define COMMON_ALL_FILEEXT       COMMON_FILEEXT_FIRST+16
  27.  
  28.    #define COMMON_FILEEXT_LAST      COMMON_FILEEXT_FIRST+32
  29.  
  30.  
  31. // When invoked by the C++ compiler, we define this in-line function
  32. // -----------------------------------------------------------------
  33.    #if _MSC_VER >= 700
  34.  
  35.    #ifdef __cpluscplus
  36.       extern "C" {
  37.    #endif
  38.  
  39.       static __inline LPSTR CommonGetFileFilter (HINSTANCE, WORD, LPSTR, WORD);
  40.  
  41.       static __inline LPSTR CommonGetFileFilter (HINSTANCE hinst, WORD idFilter, LPSTR lpszFilter, WORD cbFilter) {
  42.  
  43.       int i, cbString;
  44.       char chReplace;
  45.  
  46.          if ((cbString = LoadString (hinst, idFilter, lpszFilter, cbFilter)) > 0) {
  47.             chReplace = lpszFilter[cbString-1];
  48.             for (i = 0; lpszFilter[i] != '\0'; i++) {
  49.                 if (lpszFilter[i] == chReplace)
  50.                    lpszFilter[i] = '\0';
  51.             }
  52.             return lpszFilter;
  53.          }
  54.          else return NULL;
  55.       }
  56.  
  57.    #ifdef __cpluscplus
  58.       }
  59.    #endif
  60.  
  61.    #endif
  62.  
  63.  
  64.  
  65. // When invoked by the resource compiler, we define these STRINGTABLE entries
  66. // --------------------------------------------------------------------------
  67.    #ifndef _MSC_VER
  68.    STRINGTABLE
  69.       BEGIN
  70.  
  71.    // ... for movies
  72.       #ifdef _DEBUG
  73.          COMMON_MOVIES_FILEEXT "All Playable Movies|*.mov;*.avi;*.mpg|QuickTime Movies (*.mov)|*.mov|AVI Movies (*.avi)|*.avi|MPEG Movies (*.mpg)|*.mpg|"
  74.       #else
  75.          COMMON_MOVIES_FILEEXT "All Playable Movies|*.mov;*.mpg|QuickTime Movies (*.mov)|*.mov|MPEG Movies (*.mpg)|*.mpg|"
  76.       #endif
  77.  
  78.    // ... for pictures
  79.       COMMON_PICTURES_FILEEXT  "All Readable Pictures|*.pic;*.jpg|Macintosh PICT's (*.pic)|*.pic|JPEG Pictures (*.jpg)|*.jpg|"
  80.  
  81.    // ... the very special case of both pictures & movies together (e.g. the MCI driver)
  82.       #ifdef _DEBUG
  83.          COMMON_ALL_FILEEXT    "All Readable Files|*.mov;*.avi;*.mpg;*.pic;*.jpg|QuickTime Movies (*.mov)|*.mov|AVI Movies (*.avi)|*.avi|MPEG Movies (*.mpg)|*.mpg|Macintosh PICT's (*.pic)|*.pic|JPEG Pictures (*.jpg)|*.jpg|"
  84.       #else
  85.          COMMON_ALL_FILEEXT    "All Readable Files|*.mov;*.mpg|QuickTime Movies (*.mov)|*.mov|MPEG Movies (*.mpg)|*.mpg|Macintosh PICT's (*.pic)|*.pic|JPEG Pictures (*.jpg)|*.jpg|"
  86.       #endif
  87.  
  88.    // End of STRINGTABLE
  89.       END
  90.    #endif
  91.  
  92.  
  93. // End of FILEEXTS.HR
  94. // ------------------
  95.    #endif
  96.  
  97.